package com.bwie.controller;

import com.bwie.common.domain.Role;
import com.bwie.common.domain.User;
import com.bwie.common.domain.request.UserRequest;
import com.bwie.common.domain.response.UserResponse;
import com.bwie.common.result.Result;
import com.bwie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @className: UserController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 张雨乐
 */
@CrossOrigin
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    UserService userService;
    @PostMapping("/userLogin")
    Result<User> userLogin(@RequestBody UserRequest userRequest){
        return userService.userLogin(userRequest);
    }
    @PostMapping("/getRole")
    Result<List<Role>> getRole(@RequestBody Integer id){
        return userService.getRole(id);
    }
    @PostMapping("/userList")
    Result<List<User>> getUser(){
        return userService.getUser();
    }
}

